﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using TestProject.ServiceReference1;

namespace TestProject
{
	public class Stu 
	{
		public int Age { get; set; }
		public string Name { get; set; }
	}

	public struct Student 
	{
		public string Name { get; set; }
		public int Age { get; set; }
	}
	public class Reference
	{
		public static void Test() 
		{
			ServiceReference1.TC_FlightQueryServiceSoapClient ser = new ServiceReference1.TC_FlightQueryServiceSoapClient();
			FlightQueryCondition fqc = new FlightQueryCondition();
			ServiceReference1.FlightQueryCondition conditon = new ServiceReference1.FlightQueryCondition
			{
				QuerySegmentType = FlightSegmentType.Go,
				TakeoffBegDate = DateTime.Now,
				TakeoffEndDate = DateTime.Now,
			};

			ServiceReference1.FlightSegmentType response = new FlightSegmentType();

			var prop = response.GetType().GetProperties();

			foreach (var p in prop)
			{
				Console.WriteLine("public {1} {0}" + "{{get;set;}}", p.Name.Substring(0, 1).ToLower() + p.Name.Substring(1,p.Name.Length-1),
					p.PropertyType.Name.Replace("Int32", "int").Replace("String", "string")
					.Replace("Int64", "long").Replace("ArrayOfstring", "List<string>").
					Replace("Boolean","bool").Replace("Decimal","decimal").Replace("Byte","byte"));
			}
		}
	}
}
